{
 "cells": [
  {
   "cell_type": "code",
   "id": "initial_id",
   "metadata": {
    "collapsed": true,
    "ExecuteTime": {
     "end_time": "2025-10-29T14:56:42.509504Z",
     "start_time": "2025-10-29T14:56:42.385706Z"
    }
   },
   "source": "import numpy as np",
   "outputs": [],
   "execution_count": 2
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-10-29T16:06:22.825535Z",
     "start_time": "2025-10-29T16:06:22.593041Z"
    }
   },
   "cell_type": "code",
   "source": [
    "a = np.array([[1, 2, 3], [4, 5, 6]])\n",
    "print(a)\n",
    "print(a.ndim)\n",
    "print(a.shape)\n",
    "print(a.size)\n",
    "print(a.dtype)\n",
    "print(a.itemsize)\n"
   ],
   "id": "a4f0d081cdd81f20",
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'np' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001B[0;31m---------------------------------------------------------------------------\u001B[0m",
      "\u001B[0;31mNameError\u001B[0m                                 Traceback (most recent call last)",
      "Cell \u001B[0;32mIn[1], line 1\u001B[0m\n\u001B[0;32m----> 1\u001B[0m a \u001B[38;5;241m=\u001B[39m np\u001B[38;5;241m.\u001B[39marray([[\u001B[38;5;241m1\u001B[39m, \u001B[38;5;241m2\u001B[39m, \u001B[38;5;241m3\u001B[39m], [\u001B[38;5;241m4\u001B[39m, \u001B[38;5;241m5\u001B[39m, \u001B[38;5;241m6\u001B[39m]])\n\u001B[1;32m      2\u001B[0m \u001B[38;5;28mprint\u001B[39m(a)\n\u001B[1;32m      3\u001B[0m \u001B[38;5;28mprint\u001B[39m(a\u001B[38;5;241m.\u001B[39mndim)\n",
      "\u001B[0;31mNameError\u001B[0m: name 'np' is not defined"
     ]
    }
   ],
   "execution_count": 1
  },
  {
   "metadata": {},
   "cell_type": "markdown",
   "source": "",
   "id": "913891d28113eedf"
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-10-29T15:01:11.649882Z",
     "start_time": "2025-10-29T15:01:11.644942Z"
    }
   },
   "cell_type": "code",
   "source": [
    "data = [1,2,3]\n",
    "print(id(data))\n",
    "arr = np.array(data)\n",
    "print(id(arr))\n",
    "print(arr)\n",
    "\n",
    "print(\"-\" * 20)\n",
    "arr2 = np.array(arr)\n",
    "print(id(arr2))\n",
    "print(arr2)\n",
    "\n",
    "print(\"-\"*20)\n",
    "arr3 = np.asarray(arr)\n",
    "print(id(arr3))\n",
    "print(arr3)\n",
    "\n"
   ],
   "id": "b472f3fc5d1a17b7",
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "4515025408\n",
      "4522450288\n",
      "[1 2 3]\n",
      "--------------------\n",
      "4432180208\n",
      "[1 2 3]\n",
      "--------------------\n",
      "4522450288\n",
      "[1 2 3]\n"
     ]
    }
   ],
   "execution_count": 5
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-10-29T15:03:32.979102Z",
     "start_time": "2025-10-29T15:03:32.976171Z"
    }
   },
   "cell_type": "code",
   "source": [
    "arr = np.arange(10)\n",
    "print(arr)"
   ],
   "id": "3d9feac6014fa923",
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[0 1 2 3 4 5 6 7 8 9]\n"
     ]
    }
   ],
   "execution_count": 7
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-10-29T15:56:53.112817Z",
     "start_time": "2025-10-29T15:56:53.108313Z"
    }
   },
   "cell_type": "code",
   "source": [
    "arr1 = np.random.randint(0, 10, (3, 3))\n",
    "print(arr1)"
   ],
   "id": "3bedd045bf4c0d30",
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[[7 6 3]\n",
      " [5 2 7]\n",
      " [9 5 7]]\n"
     ]
    }
   ],
   "execution_count": 10
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
